]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
panel: fix app menu visibility after quick overview visit
authorOwen W. Taylor <otaylor@fishsoup.net>
Wed, 16 Feb 2011 20:17:46 +0000 (15:17 -0500)
committerOwen W. Taylor <otaylor@fishsoup.net>
Thu, 17 Feb 2011 16:36:35 +0000 (11:36 -0500)
If you left the overview immediately after entering it (either
intentionally or due to a bug), the app menu would mistakenly end up
hidden due to flaky interaction between its show() and hide() methods.

Based on a patch by Dan Winship <danw@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=641117

js/ui/panel.js

index 1c32e86195f299eea385f490766698562c69d887..f1a5e90975ccb8ecebaba6ae08c898d53c97a2c1 100644 (file)
@@ -220,7 +220,7 @@ AppMenuButton.prototype = {
 
         this._visible = !Main.overview.visible;
         if (!this._visible)
-            this.hide();
+            this.actor.hide();
         Main.overview.connect('hiding', Lang.bind(this, function () {
             this.show();
         }));
@@ -255,28 +255,27 @@ AppMenuButton.prototype = {
         if (this._visible)
             return;
 
+        this._visible = true;
         this.actor.show();
+        Tweener.removeTweens(this.actor);
         Tweener.addTween(this.actor,
                          { opacity: 255,
                            time: Overview.ANIMATION_TIME,
-                           transition: 'easeOutQuad',
-                           onComplete: function() {
-                               this._visible = true;
-                           },
-                           onCompleteScope: this });
+                           transition: 'easeOutQuad' });
     },
 
     hide: function() {
         if (!this._visible)
             return;
 
+        this._visible = false;
+        Tweener.removeTweens(this.actor);
         Tweener.addTween(this.actor,
                          { opacity: 0,
                            time: Overview.ANIMATION_TIME,
                            transition: 'easeOutQuad',
                            onComplete: function() {
                                this.actor.hide();
-                               this._visible = false;
                            },
                            onCompleteScope: this });
     },